#ifndef __Board_H__
#define __Board_H__

#include "cocos2d.h"

USING_NS_CC;

class LetterTile : public CCMenuItemImage
{
public:
	LetterTile(char letter, const CCPoint& pos, float fonSize = 60.0f, const char* fontName = "Arial");

	~LetterTile()
	{
	}

	void selected();

	// derived to ignore all operation
	void unselected()
	{
	}

	static void recoverAllTiles();

	void recover();

	static std::set<LetterTile*> smAllTiles;

	static std::set<LetterTile*> smSelectedTilesRecord;

	char mLetter;

	CCMenuItemImage* mImage;
	CCLabelTTF* mLableChar;
};


class Board : public CCMenu
{
public:
	void ccTouchEnded(CCTouch *touch, CCEvent* event);

	std::vector<std::string>& getRecordedWords()
	{
		return mRecordedWords;
	}

private:
	void checkAndRecordWord(const std::string& word);

	std::vector<std::string> mRecordedWords;
};

#endif // __Board_H__